
#include "vector.h"
#include <vector>

void VectorTest()
{
	Vector<int> v;
	v.insert(v.begin(), 9);
	v.insert(v.end(), 19);
	v.insert(v.begin()+1, 91);
	v.insert(v.begin()+1, 14);
	v.insert(v.begin()+1, 11);

	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
	v.erase(v.begin());
	v.erase(v.end());
	v.erase(v.begin()+1);
	v.pop_back();
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

}


void VectorTest2()
{
	Vector<int> v;

	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;


}

void VectorTest3()
{
	Vector<int> v;

	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	auto it = v.begin();
	while (it != v.end())
	{
		if (*it % 2 == 0)
		{
			it = v.insert(it, 4);
			it++;
		}
		it++;
	}

	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;
	Vector<int> v2(v.begin(), v.end());
	for (auto e : v2)
	{
		cout << e << " ";
	}
}

int main()
{
	VectorTest3();

	return 0;
}